#ifndef __CAN_H__
#define __CAN_H__

#include "app_types.h"

#define NUM_CAN_RX_ID				16 // Anzahl der unterschiedlichen RX CAN-IDs
#define NUM_CAN_TX_ID				16 // Anzahl der unterschiedlichen TX CAN-IDs

struct _can
{
	uint32_t id;
	uint8_t idx;
	uint8_t data[8];
	uint8_t dlc;
	uint8_t rtr;
};

typedef struct _can can_t;

void init_CAN(uint8_t mode);
int8_t registerRxCanID(uint32_t id);
int8_t registerTxCanID(uint32_t id);
uint8_t getCanByte(uint8_t id_idx, uint8_t byte);
void setCanByte(uint8_t id_idx, uint8_t byte, uint8_t value);
void sendCanTx(uint8_t id_idx);

#endif // __CAN_H__
